package com.lf.lexy.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.lf.comm.MyConstants;
import com.lf.lexy.model.User;

/**
 * @author lxliufei
 *
 */
public class PageInterceptor  implements Interceptor {
	
	public void intercept(Invocation inv) {
		String url = inv.getActionKey();
		//System.out.println("Before invoking " + url);
		Controller con = inv.getController();
		System.out.println(url);
		/*if(url.indexOf("view/bac/")>0 && url.indexOf("view/bac/login")==-1 ){
			User user = con.getSessionAttr(MyConstants.SESSION_USER);
			if(user==null){
				System.out.println("......");
				con.render("login.jsp");
			}else{
				inv.invoke();
			}
		}else{
			inv.invoke();
			System.out.println("请求controller 成功...");
		}*/
		inv.invoke();
	} 

}
